<#include "*/component/Tags.ftl"/>
<@Title/>
<@ClassAnnotation>
@Data
@SqlTableAlias(aliasFromClass = ${entity.entityName}CDO.class)
</@ClassAnnotation>
<@Class extends='true'>
<#-- keyword内部类开始 -->

<@ClassAnnotation>
${'\t'}@Getter
${'\t'}@SqlTableAlias(aliasFromClass = ${entity.entityName}Param.class)
${'\t'}@SqlConditionLogical(logicalOperator = LogicalOperator.OR)
</@ClassAnnotation>
<@Class static=true name="KeywordCondition" tabTimes=1>

<#list entity.fields as field >
    <@Field field=field onlyString=true tabTimes=2 type=7 comment=false useSwagger=false>
${'\t'}${'\t'}@SqlColumn(name = "${field.column.name}")
${'\t'}${'\t'}@SqlCondition(conditionOperator = ConditionOperator.INCLUDE)
${'\t'}${'\t'}@ApiModelProperty(value = "${field.column.comment}<#if field.column.remark??>(${field.column.remark})</#if>",hidden = true)
    </@Field>
</#list>

${'\t'}${'\t'}public KeywordCondition(String keyword) {
<#list entity.fields as field>
    <#if field.type == 'String'&&!field.column.isCombine>
${'\t'}${'\t'}${'\t'}this.${field.name} = keyword;
    </#if>
</#list>
${'\t'}${'\t'}}

</@Class>
<#-- keyword内部类结束 -->

${'\t'}@ApiModelProperty(hidden = true)
<#if entity.containsString>
${'\t'}@SqlCondition(multiple = true)
</#if>
${'\t'}private KeywordCondition keywordCondition;

${'\t'}@ApiModelProperty(value = "关键字"<#if !entity.containsString>,hidden = true</#if>)
${'\t'}private String keyword;

${'\t'}public void initKeyword(){
${'\t'}${'\t'}if (StringUtils.isNotBlank(keyword)){
${'\t'}${'\t'}${'\t'}this.keywordCondition = new KeywordCondition(keyword);
${'\t'}${'\t'}}
${'\t'}}

</@Class>